/**
 * 请求工具类
 */
import axios from 'axios'

const service = axios.create({
    baseURL: process.env.BASE_URL,
    timeout: process.env.TIME_OUT,
    method: 'post'
})

// 请求前拦截
service.interceptors.request.use(
  config => {
      return config
  }, error => {
    console.log(error)
    Promise.reject(error)
})

// 请求后拦截
service.interceptors.response.use(
    response => response,
    error => {
        console.log(error)
        return Promise.reject(error)
    }
)

export default service
